﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="validation_Registration" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function show() {
            alert('Hello Java Script');
        }
        function chkName(id) {
            alert('yes');
            var txtBoxElement = document.getElementById(id);
            if (txtBoxElement.value.length == 0) {
                alert('Blank Name Not Allowed!');
                txtBoxElement.focus();
                return false;
            }
            else
                return true;
        }
        function chkAge(id) {
            var validString = "0123456789";
            var inputChar = String.fromCharCode(event.keyCode)
            for (var ch in validString) {
                if (ch == inputChar)
                    return true;
            }
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td>
                    <asp:Button runat="server" ID="btnShow" Text="Show" onclick="btnShow_Click" />
                    Enter Name
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    Enter Age
                </td>
                <td>
                    <asp:TextBox ID="txtAge" runat="server" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnAdd" Text="Add" OnClick="btnAdd_Click" runat="server" />
                </td>
                <td>
                </td>
                <asp:Button ID="btnUpdate" Text="Update" OnClick="btnUpdate_Click" runat="server" />
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Label runat="server" ID="lblText" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
